﻿namespace QiangPiao
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Windows.Forms;
    using SQ.Base;

    public class FrmYuDing : UserControl
    {
        private BindingSource bdscCardType;
        private BindingSource bdscCheCi;
        private BindingSource bdscCityCode;
        private BindingSource bdscCityCodeEnd;
        private BindingSource bdscType;
        private BindingSource bdscXiBie;
        private Button btnOK;
        private DataGridViewTextBoxColumn cheCiDataGridViewTextBoxColumn;
        private ComboBoxEx cmbFrom_station_telecode;
        private ComboBox cmbPassenger_1_cardtype;
        private ComboBox cmbPassenger_1_seat;
        private ComboBox cmbPassenger_1_ticket;
        private ComboBox cmbStart_time_str;
        private ComboBoxEx cmbTo_station_telecode;
        private IContainer components;
        private DataGridViewTextBoxColumn daoTimeDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn daoZhanDataGridViewTextBoxColumn;
        private DataGridView dataGridView1;
        protected internal DataSetPiaoInfo dataSetPiaoInfo1;
        private DataGridViewTextBoxColumn deng1DataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn deng2DataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn dengSWDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn dengTDDataGridViewTextBoxColumn;
        private DateTimePicker dtTrain_date;
        private DataGridViewTextBoxColumn faTimeDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn faZhanDataGridViewTextBoxColumn;
        private FrmMain frmMain;
        public bool IsRun;
        private Label label1;
        private Label label10;
        private Label label11;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private object m_lock;
        private Panel panel1;
        private Panel panel10;
        private Panel panel11;
        private Panel panel12;
        private Panel panel2;
        private Panel panel3;
        private Panel panel4;
        private Panel panel5;
        private Panel panel6;
        private Panel panel7;
        private Panel panel8;
        private Panel panel9;
        private DataGridViewLinkColumn postParDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn qiTaDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn rowIDDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn ruanWoDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn ruanWoGaojiDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn ruanZuoDataGridViewTextBoxColumn;
        private TableLayoutPanel tableLayoutPanel1;
        private DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn;
        private TextBox txtPassenger_1_cardno;
        private TextBox txtPassenger_1_mobileno;
        private TextBox txtPassenger_1_name;
        private TextBox txtTrain_no;
        private DataGridViewTextBoxColumn wuZuoDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn yingWoDataGridViewTextBoxColumn;
        private DataGridViewTextBoxColumn yingZuoDataGridViewTextBoxColumn;

        private FrmYuDing()
            : this(null)
        {
        }

        public FrmYuDing(FrmMain frmMain)
        {
            this.IsRun = false;
            this.m_lock = new object();
            this.components = null;
            this.InitializeComponent();
            this.frmMain = frmMain;
            this.cmbStart_time_str.SelectedIndex = 0;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if(this.frmMain.IsLogin)
            {
                if(this.cmbFrom_station_telecode.SelectedIndex == -1)
                {
                    MessageBox.Show("发站必须填写！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if(this.cmbTo_station_telecode.SelectedIndex == -1)
                {
                    MessageBox.Show("到站必须填写！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if(this.cmbFrom_station_telecode.SelectedValue == this.cmbTo_station_telecode.SelectedValue)
                {
                    MessageBox.Show("发到站不能一样！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if(this.dtTrain_date.Value < DateTime.Today)
                {
                    MessageBox.Show("日期不能小于今天！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    this.btnOK.Enabled = false;
                    new Thread(new ThreadStart(this.GetYuPiao)) { IsBackground = true }.Start();
                }
            }
            else
            {
                MessageBox.Show("请先登录！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }

        private int confirmPassengerAction(ref string strhtml, ref string RandCode)
        {
            try
            {
                Match bed_level_order_num = this.frmMain.regbed_level_order_num.Match(strhtml);
                Match cancel_flag = this.frmMain.regcancel_flag.Match(strhtml);
                Match end_time = this.frmMain.regend_time.Match(strhtml);
                Match from_station_name = this.frmMain.regfrom_station_name.Match(strhtml);
                Match from_station_telecode = this.frmMain.regfrom_station_telecode.Match(strhtml);
                Match id_mode = this.frmMain.regid_mode.Match(strhtml);
                Match seat_type_code = this.frmMain.regseat_type_code.Match(strhtml);
                Match start_time = this.frmMain.regstart_time.Match(strhtml);
                Match station_train_code = this.frmMain.regstation_train_code.Match(strhtml);
                Match ticket_type_order_num = this.frmMain.regticket_type_order_num.Match(strhtml);
                Match to_station_name = this.frmMain.regto_station_name.Match(strhtml);
                Match to_station_telecode = this.frmMain.regto_station_telecode.Match(strhtml);
                Match train_date = this.frmMain.regtrain_date.Match(strhtml);
                Match train_no = this.frmMain.regtrain_no.Match(strhtml);
                Match TOKEN = this.frmMain.regTOKEN.Match(strhtml);
                if(((((cancel_flag.Success && end_time.Success) && (from_station_name.Success && from_station_telecode.Success)) && ((id_mode.Success && seat_type_code.Success) && (start_time.Success && station_train_code.Success))) && (((ticket_type_order_num.Success && to_station_name.Success) && (to_station_telecode.Success && train_date.Success)) && train_no.Success)) && TOKEN.Success)
                {
                    MethodInvoker method = null;
                    bool flag = true;
                    string sttmp = RandCode;
                    bool sForce = false;
                    if(RandCode == null)
                    {
                        if(method == null)
                        {
                            method = delegate
                            {
                                FrmYDCfm cfm = new FrmYDCfm(this.frmMain);
                                cfm.ShowDialog();
                                flag = !cfm.IsCancel;
                                sttmp = cfm.txtCheckCode.Text.Trim();
                                sForce = cfm.chkSend100.Checked;
                            };
                        }
                        base.Invoke(method);
                    }
                    if(flag)
                    {
                        ThreadStart start = null;
                        sForce = true;
                        //(PublicInfo.AuthorizeInfo.ForceTimes > 1) && sForce;
                        string strUrl = "";

                        base.Invoke(
                          (MethodInvoker)delegate()
                          {
                              #region Delete


                              /*strUrl = string.Format("org.apache.struts.taglib.html.TOKEN=d6516ddf42c92938a2c41106beadcb7f&textfield=%E4%B8%AD%E6%96%87%E6%88%96%E6%8B%BC%E9%9F%B3%E9%A6%96%E5%AD%97%E6%AF%8D&checkbox0=0&checkbox2=2&checkbox3=3&checkbox4=4&orderRequest.train_date=2012-01-20&orderRequest.train_no=850000K86220&orderRequest.station_train_code=K862&orderRequest.from_station_telecode=LZJ&orderRequest.to_station_telecode=ZDN&orderRequest.seat_type_code=&orderRequest.ticket_type_order_num=&orderRequest.bed_level_order_num=000000000000000000000000000000&orderRequest.start_time=09%3A58&orderRequest.end_time=05%3A58&orderRequest.from_station_name=%E5%85%B0%E5%B7%9E&orderRequest.to_station_name=%E9%A9%BB%E9%A9%AC%E5%BA%97&orderRequest.cancel_flag=1&orderRequest.id_mode=Y&passengerTickets=3%2C1%2C%E7%A8%8B%E4%BA%9A%E6%98%8E%2C1%2C412821198812026821%2C13379187914%2CY&oldPassengers=%E7%A8%8B%E4%BA%9A%E6%98%8E%2C1%2C412821198812026821&" +
"passenger_1_seat=3&passenger_1_ticket=1&passenger_1_name=%E7%A8%8B%E4%BA%9A%E6%98%8E&passenger_1_cardtype=1&" +
"passenger_1_cardno=412821198812026821&passenger_1_mobileno=13379187914&checkbox9=Y&" +
"passengerTickets=3%2C1%2C%E8%83%A1%E6%98%A5%E7%94%9F%2C1%2C41282119590102682X%2C13379187914%2CY&oldPassengers=%E8%83%A1%E6%98%A5%E7%94%9F%2C1%2C41282119590102682X&" +

"passenger_2_seat=3&passenger_2_ticket=1&passenger_2_name=%E8%83%A1%E6%98%A5%E7%94%9F&passenger_2_cardtype=1&passenger_2_cardno=41282119590102682X&passenger_2_mobileno=13379187914&checkbox9=Y&passengerTickets=3%2C1%2C%E7%8E%8B%E5%BB%BA%2C1%2C412821195912286811%2C18681811611%2CY&oldPassengers=%E7%8E%8B%E5%BB%BA%2C1%2C412821195912286811&passenger_3_seat=3&passenger_3_ticket=1&passenger_3_name=%E7%8E%8B%E5%BB%BA&passenger_3_cardtype=1&passenger_3_cardno=412821195912286811&passenger_3_mobileno=18681811611&checkbox9=Y&passengerTickets=3%2C1%2C%E7%8E%8B%E8%8E%B9%2C1%2C412821198505096846%2C13379187914%2CY&oldPassengers=%E7%8E%8B%E8%8E%B9%2C1%2C412821198505096846&passenger_4_seat=3&passenger_4_ticket=1&passenger_4_name=%E7%8E%8B%E8%8E%B9&passenger_4_cardtype=1&passenger_4_cardno=412821198505096846&passenger_4_mobileno=13379187914&checkbox9=Y&oldPassengers=&checkbox9=Y&randCode=33KT&orderRequest.reserve_flag=A");


                              strUrl = "org.apache.struts.taglib.html.TOKEN=d6516ddf42c92938a2c41106beadcb7f&textfield=中文或拼音首字母&checkbox0=0&checkbox2=2&checkbox3=3&checkbox4=4&orderRequest.train_date=2012-01-20&orderRequest.train_no=850000K86220&orderRequest.station_train_code=K862&orderRequest.from_station_telecode=LZJ&orderRequest.to_station_telecode=ZDN&orderRequest.seat_type_code=&orderRequest.ticket_type_order_num=&orderRequest.bed_level_order_num=000000000000000000000000000000&orderRequest.start_time=09:58&orderRequest.end_time=05:58&orderRequest.from_station_name=兰州&orderRequest.to_station_name=驻马店&orderRequest.cancel_flag=1&orderRequest.id_mode=Y&" +

                                  "passengerTickets=3,1,程亚明,1,412821198812026821,13379187914,Y&oldPassengers=程亚明,1,412821198812026821&passenger_1_seat=3&passenger_1_ticket=1&passenger_1_name=程亚明&passenger_1_cardtype=1&passenger_1_cardno=412821198812026821&passenger_1_mobileno=13379187914&checkbox9=Y&" +

                                  "passengerTickets=3,1,胡春生,1,41282119590102682X,13379187914,Y&" +
                                  "oldPassengers=胡春生,1,41282119590102682X&" +
                                  "passenger_2_seat=3&" +
                                  "passenger_2_ticket=1&" +
                                  "passenger_2_name=胡春生&" +
                                  "passenger_2_cardtype=1&" +
                                  "passenger_2_cardno=41282119590102682X&" +
                                  "passenger_2_mobileno=13379187914&" +
                                  "checkbox9=Y&" +

                                  "passengerTickets=3,1,王建,1,412821195912286811,18681811611,Y&" +
                                  "oldPassengers=王建,1,412821195912286811&" +
                                  "passenger_3_seat=3&" +
                                  "passenger_3_ticket=1&" +
                                  "passenger_3_name=王建&" +
                                  "passenger_3_cardtype=1&" +
                                  "passenger_3_cardno=412821195912286811&" +
                                  "passenger_3_mobileno=18681811611&" +
                                  "checkbox9=Y&" +

                                  "passengerTickets=3,1,王莹,1,412821198505096846,13379187914,Y&" +
                                  "oldPassengers=王莹,1,412821198505096846&passenger_4_seat=3&passenger_4_ticket=1&passenger_4_name=王莹&passenger_4_cardtype=1&passenger_4_cardno=412821198505096846&" +
                                  "passenger_4_mobileno=13379187914&" +
                                  "checkbox9=Y&" +
                                  "oldPassengers=&checkbox9=Y&randCode=33KT&orderRequest.reserve_flag=A";*/

                              #endregion

                              StringBuilder urlBuilder = new StringBuilder();
                              urlBuilder.AppendFormat("https://dynamic.12306.cn/otsweb/order/confirmPassengerAction.do?method=confirmPassengerInfoSingle&checkbox9=Y&checkbox9=Y&checkbox9=Y&checkbox9=Y&checkbox9=Y&oldPassengers=&oldPassengers=&oldPassengers=&oldPassengers=&oldPassengers=&orderRequest.bed_level_order_num={0}&orderRequest.cancel_flag={1}&orderRequest.end_time={2}&orderRequest.from_station_name={3}&orderRequest.from_station_telecode={4}&orderRequest.id_mode={5}&orderRequest.reserve_flag={6}&orderRequest.seat_type_code={7}&orderRequest.start_time={8}&orderRequest.station_train_code={9}&orderRequest.ticket_type_order_num={10}&orderRequest.to_station_name={11}&orderRequest.to_station_telecode={12}&orderRequest.train_date={13}&orderRequest.train_no={14}&org.apache.struts.taglib.html.TOKEN={15}&",
                                    bed_level_order_num.Groups[1].Value,
                                cancel_flag.Groups[1].Value,
                                end_time.Groups[1].Value,
                                from_station_name.Groups[1].Value,
                                from_station_telecode.Groups[1].Value,
                                id_mode.Groups[1].Value, "A",
                                seat_type_code.Groups[1].Value,
                                start_time.Groups[1].Value,
                                station_train_code.Groups[1].Value,
                                ticket_type_order_num.Groups[1].Value,
                                to_station_name.Groups[1].Value,
                                to_station_telecode.Groups[1].Value,
                                train_date.Groups[1].Value,
                                train_no.Groups[1].Value,
                                TOKEN.Groups[1].Value);
                              //this.cmbPassenger_1_seat.SelectedValue, 
                              // this.cmbPassenger_1_ticket.SelectedValue,
                              // this.txtPassenger_1_name.Text, 
                              // this.cmbPassenger_1_cardtype.SelectedValue, 
                              // this.txtPassenger_1_cardno.Text, 
                              // this.txtPassenger_1_mobileno.Text, 
                              List<Person.Persons> perList = Person.ConfigBase.GetPerson();
                              if (perList != null)
                              {
                                  for (int i = 0; i < perList.Count; i++)
                                  {
                                      urlBuilder.AppendFormat("passengerTickets={0},{1},{2},{3},{4},{5},Y&passenger_{6}_cardno={4}&passenger_{6}_cardtype={3}&passenger_{6}_mobileno={5}&passenger_{6}_name={2}&passenger_{6}_seat={0}&" + "passenger_{6}_ticket={1}&", this.cmbPassenger_1_seat.SelectedValue, this.cmbPassenger_1_ticket.SelectedValue, perList[i].UserName, perList[i].LType, perList[i].CardId, perList[i].Phone, i+1);
                                  }
                              }
                              else
                              {
                                  return;
                              }
                                   

                              urlBuilder.AppendFormat("randCode={0}&textfield=%E4%B8%AD%E6%96%87%E6%88%96%E6%8B%BC%E9%9F%B3%E9%A6%96%E5%AD%97%E6%AF%8D", sttmp);
                              strUrl = urlBuilder.ToString();
                              #region Delete
                              /*strUrl = string.Format("https://dynamic.12306.cn/otsweb/order/confirmPassengerAction.do?method=confirmPassengerInfoSingle&checkbox9=Y&checkbox9=Y&checkbox9=Y&checkbox9=Y&checkbox9=Y&oldPassengers=&oldPassengers=&oldPassengers=&oldPassengers=&oldPassengers=&orderRequest.bed_level_order_num={0}&orderRequest.cancel_flag={1}&orderRequest.end_time={2}&orderRequest.from_station_name={3}&orderRequest.from_station_telecode={4}&orderRequest.id_mode={5}&orderRequest.reserve_flag={6}&orderRequest.seat_type_code={7}&orderRequest.start_time={8}&orderRequest.station_train_code={9}&orderRequest.ticket_type_order_num={10}&orderRequest.to_station_name={11}&orderRequest.to_station_telecode={12}&orderRequest.train_date={13}&orderRequest.train_no={14}&org.apache.struts.taglib.html.TOKEN={15}&" +
                                  "passengerTickets={16},{17},{18},{19},{20},{21},Y&" +
                                  "passenger_1_cardno={20}&" +
                                  "passenger_1_cardtype={19}&" +
                                  "passenger_1_mobileno={21}&" +
                                  "passenger_1_name={18}&" +
                                  "passenger_1_seat={16}&" +
                                  "passenger_1_ticket={17}&" +
                                  "randCode={22}&textfield=%E4%B8%AD%E6%96%87%E6%88%96%E6%8B%BC%E9%9F%B3%E9%A6%96%E5%AD%97%E6%AF%8D", new object[] { 
                                bed_level_order_num.Groups[1].Value,
                                cancel_flag.Groups[1].Value, 
                                end_time.Groups[1].Value,
                                from_station_name.Groups[1].Value, 
                                from_station_telecode.Groups[1].Value, 
                                id_mode.Groups[1].Value,
                                "A", 
                                seat_type_code.Groups[1].Value,
                                start_time.Groups[1].Value,
                                station_train_code.Groups[1].Value,
                                ticket_type_order_num.Groups[1].Value,
                                to_station_name.Groups[1].Value, 
                                to_station_telecode.Groups[1].Value, 
                                train_date.Groups[1].Value,
                                train_no.Groups[1].Value,
                                TOKEN.Groups[1].Value, 
                                this.cmbPassenger_1_seat.SelectedValue, 
                                this.cmbPassenger_1_ticket.SelectedValue,
                                this.txtPassenger_1_name.Text, 
                                this.cmbPassenger_1_cardtype.SelectedValue, 
                                this.txtPassenger_1_cardno.Text, 
                                this.txtPassenger_1_mobileno.Text, 
                                sttmp
                             });*/

                              #endregion
                          });
                        RandCode = sttmp;
                        if(sForce)
                        {
                            //for(int i = 0; i < PublicInfo.AuthorizeInfo.ForceTimes; i++)
                            //{
                            //    if(start == null)
                            //    {
                            //        start = delegate
                            //        {
                            //            try
                            //            {
                            //                string strhtml2 = this.frmMain.http.PostPage(strUrl, "");
                            //                lock(this.m_lock)
                            //                {
                            //                    if(this.IsRun && (this.JXConfirm(strhtml2) == 2))
                            //                    {
                            //                        this.IsRun = false;
                            //                    }
                            //                }
                            //            }
                            //            catch(Exception exception)
                            //            {
                            //                Log.WriteLog4Ex("ForcePost", exception);
                            //            }
                            //        };
                            //    }
                            //    new Thread(start) { IsBackground = true }.Start();
                            //}
                        }
                        strhtml = this.frmMain.http.PostPage(strUrl, "");
                        this.frmMain.WriteHtml(strhtml);
                        lock(this.m_lock)
                        {
                            if(this.IsRun)
                            {
                                return this.JXConfirm(strhtml);
                            }
                        }
                    }
                }
                else
                {
                    this.frmMain.WriteInfo("未加载成功车次信息，已停止确认！");
                }
            }
            catch(Exception exception)
            {
                this.frmMain.WriteInfo("确认订单发生错误，已停止确认，错误详细信息：" + exception.Message);
                Log.WriteLog4Ex("确认订单错误", exception);
            }
            return 0;
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if(this.dataGridView1.Columns[e.ColumnIndex].DataPropertyName == "PostPar")
                {
                    DataSetPiaoInfo.DTCheCiRow row = (this.bdscCheCi.Current as DataRowView).Row as DataSetPiaoInfo.DTCheCiRow;
                    //if(PublicInfo.AuthorizeInfo.AuthorizeTimes < 1)
                    //{
                    //    MessageBox.Show("你的当日预定次数已用完，如还需订票，请联系作者！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    //}
                    //else
                    if(row.PostPar != "")
                    {
                        this.submutOrderRequest(row.PostPar);
                    }
                    else
                    {
                        MessageBox.Show("当前车票不足", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
            }
            catch(Exception exception)
            {
                MessageBox.Show(exception.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Log.WriteLog4Ex("dataGridView1_CellContentClick", exception);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if(disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmYuDing_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.IsRun = false;
        }

        private void GetYuPiao()
        {
            try
            {
                this.frmMain.ChangeState("获取余票中");
                Random random = new Random();
                string strdtTrain_date = null;
                string strcmbFrom_station_telecode = null;
                string strcmbTo_station_telecode = null;
                string strtxtTrain_no = null;
                string strcmbStart_time_str = null;
                base.Invoke(
                    (MethodInvoker)delegate()
                    {
                        strdtTrain_date = this.dtTrain_date.Value.ToString("yyyy-MM-dd");
                        strcmbFrom_station_telecode = this.cmbFrom_station_telecode.SelectedValue.ToString();
                        strcmbTo_station_telecode = this.cmbTo_station_telecode.SelectedValue.ToString();
                        strtxtTrain_no = this.txtTrain_no.Text;
                        strcmbStart_time_str = this.cmbStart_time_str.SelectedItem.ToString();
                    }
                );
                string hTML = this.frmMain.http.GetHTML(string.Format("https://dynamic.12306.cn/otsweb/order/querySingleAction.do?method=queryLeftTicket&orderRequest.train_date={0}&orderRequest.from_station_telecode={1}&orderRequest.to_station_telecode={2}&orderRequest.train_no={3}&trainPassType=QB&trainClass=QB%23D%23Z%23T%23K%23QT%23&includeStudent=00&seatTypeAndNum=&orderRequest.start_time_str={4}&{5}", new object[]
				{
					strdtTrain_date, 
					strcmbFrom_station_telecode, 
					strcmbTo_station_telecode, 
					strtxtTrain_no, 
					strcmbStart_time_str, 
					random.NextDouble()
				}), "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
                this.frmMain.WriteHtml(hTML);
                MatchCollection mths = this.frmMain.rexlst.Matches(hTML);
                base.Invoke(
                    (MethodInvoker)delegate()
                    {
                        this.dataSetPiaoInfo1.DTCheCi.Clear();
                        foreach(Match match in mths)
                        {
                            Match match2 = this.frmMain.rexFun.Match(match.Groups[23].Value);
                            string postPar;
                            if(match2.Success)
                            {
                                string arg_1D3_0 = "method=submutOrderRequest&arrive_time={0}&from_station_name={1}&from_station_telecode={2}&from_station_telecode_name={3}&include_student=00&lishi={4}&round_start_time_str={5}&round_train_date={6}&seattype_num=&single_round_type=1&start_time_str={5}&station_train_code={7}&to_station_name={8}&to_station_telecode={9}&to_station_telecode_name={10}&train_class_arr=QB%23D%23Z%23T%23K%23QT%23&train_date={11}&train_pass_type=QB&train_start_time={12}&trainno={13}&ypInfoDetail={14}";
                                object[] array = new object[15];
                                array[0] = match2.Groups[7].Value;
                                array[1] = match2.Groups[8].Value;
                                array[2] = match2.Groups[5].Value;
                                array[3] = match2.Groups[8].Value;
                                array[4] = match2.Groups[2].Value;
                                array[5] = this.cmbStart_time_str.SelectedItem;
                                object[] arg_112_0 = array;
                                int arg_112_1 = 6;
                                DateTime dateTime = DateTime.Now;
                                arg_112_0[arg_112_1] = dateTime.ToString("yyyy-MM-dd");
                                array[7] = match2.Groups[1].Value;
                                array[8] = match2.Groups[9].Value;
                                array[9] = match2.Groups[6].Value;
                                array[10] = match2.Groups[9].Value;
                                object[] arg_18D_0 = array;
                                int arg_18D_1 = 11;
                                dateTime = this.dtTrain_date.Value;
                                arg_18D_0[arg_18D_1] = dateTime.ToString("yyyy-MM-dd");
                                array[12] = match2.Groups[3].Value;
                                array[13] = match2.Groups[4].Value;
                                array[14] = match2.Groups[10].Value;
                                postPar = string.Format(arg_1D3_0, array);
                            }
                            else
                            {
                                postPar = "";
                            }
                            this.dataSetPiaoInfo1.DTCheCi.AddDTCheCiRow(match.Groups[1].Value, match.Groups[2].Value, match.Groups[5].Value.Replace("&nbsp;", ""), match.Groups[6].Value.Replace("&nbsp;", ""), match.Groups[9].Value.Replace("&nbsp;", ""), match.Groups[10].Value.Replace("&nbsp;", ""), match.Groups[11].Value, match.Groups[12].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[13].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[14].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[15].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[16].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[17].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[18].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[19].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[20].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[21].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), match.Groups[22].Value.Replace("<font color='#008800'>有</font>", "票量充足").Replace("<font color='darkgray'>无</font>", "无票"), postPar);
                        }
                    }
                );
            }
            catch(Exception ex)
            {
                this.frmMain.WriteInfo("获取余票信息发生错误，错误详细信息：" + ex.Message);
                Log.WriteLog4Ex("GetYuPiao", ex);
            }
            finally
            {
                base.BeginInvoke(
                    (MethodInvoker)delegate()
                    {
                        this.btnOK.Enabled = true;
                        MessageBox.Show("余票信息获取完成，如果存在车次信息，现在可点击[选这趟车]进行预定！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                );
                this.frmMain.ChangeState("待命");
            }
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.cmbPassenger_1_seat = new System.Windows.Forms.ComboBox();
            this.bdscXiBie = new System.Windows.Forms.BindingSource(this.components);
            this.dataSetPiaoInfo1 = new QiangPiao.DataSetPiaoInfo();
            this.label1 = new System.Windows.Forms.Label();
            this.cmbPassenger_1_ticket = new System.Windows.Forms.ComboBox();
            this.bdscType = new System.Windows.Forms.BindingSource(this.components);
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.txtPassenger_1_name = new System.Windows.Forms.TextBox();
            this.bdscCardType = new System.Windows.Forms.BindingSource(this.components);
            this.cmbPassenger_1_cardtype = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.txtPassenger_1_cardno = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.txtPassenger_1_mobileno = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.cmbFrom_station_telecode = new QiangPiao.ComboBoxEx();
            this.bdscCityCode = new System.Windows.Forms.BindingSource(this.components);
            this.cmbTo_station_telecode = new QiangPiao.ComboBoxEx();
            this.bdscCityCodeEnd = new System.Windows.Forms.BindingSource(this.components);
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.dtTrain_date = new System.Windows.Forms.DateTimePicker();
            this.label10 = new System.Windows.Forms.Label();
            this.cmbStart_time_str = new System.Windows.Forms.ComboBox();
            this.label11 = new System.Windows.Forms.Label();
            this.txtTrain_no = new System.Windows.Forms.TextBox();
            this.btnOK = new System.Windows.Forms.Button();
            this.bdscCheCi = new System.Windows.Forms.BindingSource(this.components);
            this.dataGridView1 = new System.Windows.Forms.DataGridView();
            this.rowIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.cheCiDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.faZhanDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.faTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.daoZhanDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.daoTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.timeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dengSWDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dengTDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.deng1DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.deng2DataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ruanWoGaojiDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ruanWoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.yingWoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ruanZuoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.yingZuoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.wuZuoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.qiTaDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.postParDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewLinkColumn();
            this.panel1 = new System.Windows.Forms.Panel();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.panel7 = new System.Windows.Forms.Panel();
            this.panel6 = new System.Windows.Forms.Panel();
            this.panel5 = new System.Windows.Forms.Panel();
            this.panel4 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.panel3 = new System.Windows.Forms.Panel();
            this.panel8 = new System.Windows.Forms.Panel();
            this.panel9 = new System.Windows.Forms.Panel();
            this.panel10 = new System.Windows.Forms.Panel();
            this.panel11 = new System.Windows.Forms.Panel();
            this.panel12 = new System.Windows.Forms.Panel();
            ((System.ComponentModel.ISupportInitialize)(this.bdscXiBie)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSetPiaoInfo1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscType)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCardType)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCityCode)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCityCodeEnd)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCheCi)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.panel1.SuspendLayout();
            this.tableLayoutPanel1.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel5.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel8.SuspendLayout();
            this.panel9.SuspendLayout();
            this.panel10.SuspendLayout();
            this.panel11.SuspendLayout();
            this.panel12.SuspendLayout();
            this.SuspendLayout();
            // 
            // cmbPassenger_1_seat
            // 
            this.cmbPassenger_1_seat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbPassenger_1_seat.DataSource = this.bdscXiBie;
            this.cmbPassenger_1_seat.DisplayMember = "Text";
            this.cmbPassenger_1_seat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbPassenger_1_seat.FormattingEnabled = true;
            this.cmbPassenger_1_seat.Location = new System.Drawing.Point(56, 4);
            this.cmbPassenger_1_seat.Name = "cmbPassenger_1_seat";
            this.cmbPassenger_1_seat.Size = new System.Drawing.Size(155, 20);
            this.cmbPassenger_1_seat.TabIndex = 9;
            this.cmbPassenger_1_seat.ValueMember = "ID";
            // 
            // bdscXiBie
            // 
            this.bdscXiBie.DataMember = "DTPiaoXiBie";
            this.bdscXiBie.DataSource = this.dataSetPiaoInfo1;
            // 
            // dataSetPiaoInfo1
            // 
            this.dataSetPiaoInfo1.DataSetName = "DataSetPiaoInfo";
            this.dataSetPiaoInfo1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(3, 7);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(35, 12);
            this.label1.TabIndex = 1;
            this.label1.Text = "席别:";
            // 
            // cmbPassenger_1_ticket
            // 
            this.cmbPassenger_1_ticket.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbPassenger_1_ticket.DataSource = this.bdscType;
            this.cmbPassenger_1_ticket.DisplayMember = "Text";
            this.cmbPassenger_1_ticket.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbPassenger_1_ticket.FormattingEnabled = true;
            this.cmbPassenger_1_ticket.Location = new System.Drawing.Point(44, 4);
            this.cmbPassenger_1_ticket.Name = "cmbPassenger_1_ticket";
            this.cmbPassenger_1_ticket.Size = new System.Drawing.Size(133, 20);
            this.cmbPassenger_1_ticket.TabIndex = 10;
            this.cmbPassenger_1_ticket.ValueMember = "ID";
            // 
            // bdscType
            // 
            this.bdscType.DataMember = "DTPiaoType";
            this.bdscType.DataSource = this.dataSetPiaoInfo1;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(3, 7);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(35, 12);
            this.label2.TabIndex = 1;
            this.label2.Text = "票种:";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(3, 7);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(35, 12);
            this.label3.TabIndex = 1;
            this.label3.Text = "姓名:";
            // 
            // txtPassenger_1_name
            // 
            this.txtPassenger_1_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.txtPassenger_1_name.Enabled = false;
            this.txtPassenger_1_name.Location = new System.Drawing.Point(56, 4);
            this.txtPassenger_1_name.Name = "txtPassenger_1_name";
            this.txtPassenger_1_name.Size = new System.Drawing.Size(130, 21);
            this.txtPassenger_1_name.TabIndex = 7;
            // 
            // bdscCardType
            // 
            this.bdscCardType.DataMember = "DTCardType";
            this.bdscCardType.DataSource = this.dataSetPiaoInfo1;
            // 
            // cmbPassenger_1_cardtype
            // 
            this.cmbPassenger_1_cardtype.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbPassenger_1_cardtype.DataSource = this.bdscCardType;
            this.cmbPassenger_1_cardtype.DisplayMember = "Text";
            this.cmbPassenger_1_cardtype.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbPassenger_1_cardtype.Enabled = false;
            this.cmbPassenger_1_cardtype.FormattingEnabled = true;
            this.cmbPassenger_1_cardtype.Location = new System.Drawing.Point(63, 3);
            this.cmbPassenger_1_cardtype.Name = "cmbPassenger_1_cardtype";
            this.cmbPassenger_1_cardtype.Size = new System.Drawing.Size(133, 20);
            this.cmbPassenger_1_cardtype.TabIndex = 5;
            this.cmbPassenger_1_cardtype.ValueMember = "ID";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(3, 7);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(59, 12);
            this.label4.TabIndex = 1;
            this.label4.Text = "证件类型:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(3, 6);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(47, 12);
            this.label5.TabIndex = 1;
            this.label5.Text = "证件号:";
            // 
            // txtPassenger_1_cardno
            // 
            this.txtPassenger_1_cardno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.txtPassenger_1_cardno.Enabled = false;
            this.txtPassenger_1_cardno.Location = new System.Drawing.Point(56, 3);
            this.txtPassenger_1_cardno.Name = "txtPassenger_1_cardno";
            this.txtPassenger_1_cardno.Size = new System.Drawing.Size(337, 21);
            this.txtPassenger_1_cardno.TabIndex = 6;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(1, 7);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(47, 12);
            this.label6.TabIndex = 1;
            this.label6.Text = "手机号:";
            // 
            // txtPassenger_1_mobileno
            // 
            this.txtPassenger_1_mobileno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.txtPassenger_1_mobileno.Enabled = false;
            this.txtPassenger_1_mobileno.Location = new System.Drawing.Point(63, 4);
            this.txtPassenger_1_mobileno.Name = "txtPassenger_1_mobileno";
            this.txtPassenger_1_mobileno.Size = new System.Drawing.Size(133, 21);
            this.txtPassenger_1_mobileno.TabIndex = 8;
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(3, 6);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(47, 12);
            this.label7.TabIndex = 1;
            this.label7.Text = "出发地:";
            // 
            // cmbFrom_station_telecode
            // 
            this.cmbFrom_station_telecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbFrom_station_telecode.DataSource = this.bdscCityCode;
            this.cmbFrom_station_telecode.DisplayMember = "Text";
            this.cmbFrom_station_telecode.FormattingEnabled = true;
            this.cmbFrom_station_telecode.Location = new System.Drawing.Point(56, 3);
            this.cmbFrom_station_telecode.Name = "cmbFrom_station_telecode";
            this.cmbFrom_station_telecode.Size = new System.Drawing.Size(130, 20);
            this.cmbFrom_station_telecode.TabIndex = 0;
            this.cmbFrom_station_telecode.ValueMember = "ID";
            // 
            // bdscCityCode
            // 
            this.bdscCityCode.DataMember = "DTCityCode";
            this.bdscCityCode.DataSource = this.dataSetPiaoInfo1;
            // 
            // cmbTo_station_telecode
            // 
            this.cmbTo_station_telecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbTo_station_telecode.DataSource = this.bdscCityCodeEnd;
            this.cmbTo_station_telecode.DisplayMember = "Text";
            this.cmbTo_station_telecode.FormattingEnabled = true;
            this.cmbTo_station_telecode.Location = new System.Drawing.Point(63, 3);
            this.cmbTo_station_telecode.Name = "cmbTo_station_telecode";
            this.cmbTo_station_telecode.Size = new System.Drawing.Size(133, 20);
            this.cmbTo_station_telecode.TabIndex = 1;
            this.cmbTo_station_telecode.ValueMember = "ID";
            // 
            // bdscCityCodeEnd
            // 
            this.bdscCityCodeEnd.DataMember = "DTCityCode";
            this.bdscCityCodeEnd.DataSource = this.dataSetPiaoInfo1;
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(3, 6);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(47, 12);
            this.label8.TabIndex = 1;
            this.label8.Text = "目的地:";
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(3, 6);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(35, 12);
            this.label9.TabIndex = 1;
            this.label9.Text = "日期:";
            // 
            // dtTrain_date
            // 
            this.dtTrain_date.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.dtTrain_date.Location = new System.Drawing.Point(56, 3);
            this.dtTrain_date.Name = "dtTrain_date";
            this.dtTrain_date.Size = new System.Drawing.Size(155, 21);
            this.dtTrain_date.TabIndex = 2;
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(3, 6);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(35, 12);
            this.label10.TabIndex = 1;
            this.label10.Text = "时间:";
            // 
            // cmbStart_time_str
            // 
            this.cmbStart_time_str.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbStart_time_str.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbStart_time_str.FormattingEnabled = true;
            this.cmbStart_time_str.Items.AddRange(new object[] {
            "00:00--24:00",
            "00:00--06:00",
            "06:00--12:00",
            "12:00--18:00",
            "18:00--24:00"});
            this.cmbStart_time_str.Location = new System.Drawing.Point(44, 3);
            this.cmbStart_time_str.Name = "cmbStart_time_str";
            this.cmbStart_time_str.Size = new System.Drawing.Size(133, 20);
            this.cmbStart_time_str.TabIndex = 3;
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(3, 7);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(35, 12);
            this.label11.TabIndex = 1;
            this.label11.Text = "车次:";
            // 
            // txtTrain_no
            // 
            this.txtTrain_no.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTrain_no.Location = new System.Drawing.Point(56, 3);
            this.txtTrain_no.Name = "txtTrain_no";
            this.txtTrain_no.Size = new System.Drawing.Size(130, 21);
            this.txtTrain_no.TabIndex = 4;
            // 
            // btnOK
            // 
            this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnOK.Location = new System.Drawing.Point(718, 82);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new System.Drawing.Size(75, 23);
            this.btnOK.TabIndex = 11;
            this.btnOK.Text = "确定";
            this.btnOK.UseVisualStyleBackColor = true;
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            // 
            // bdscCheCi
            // 
            this.bdscCheCi.DataMember = "DTCheCi";
            this.bdscCheCi.DataSource = this.dataSetPiaoInfo1;
            // 
            // dataGridView1
            // 
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.AllowUserToDeleteRows = false;
            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
            this.dataGridView1.CausesValidation = false;
            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.rowIDDataGridViewTextBoxColumn,
            this.cheCiDataGridViewTextBoxColumn,
            this.faZhanDataGridViewTextBoxColumn,
            this.faTimeDataGridViewTextBoxColumn,
            this.daoZhanDataGridViewTextBoxColumn,
            this.daoTimeDataGridViewTextBoxColumn,
            this.timeDataGridViewTextBoxColumn,
            this.dengSWDataGridViewTextBoxColumn,
            this.dengTDDataGridViewTextBoxColumn,
            this.deng1DataGridViewTextBoxColumn,
            this.deng2DataGridViewTextBoxColumn,
            this.ruanWoGaojiDataGridViewTextBoxColumn,
            this.ruanWoDataGridViewTextBoxColumn,
            this.yingWoDataGridViewTextBoxColumn,
            this.ruanZuoDataGridViewTextBoxColumn,
            this.yingZuoDataGridViewTextBoxColumn,
            this.wuZuoDataGridViewTextBoxColumn,
            this.qiTaDataGridViewTextBoxColumn,
            this.postParDataGridViewTextBoxColumn});
            this.dataGridView1.DataSource = this.bdscCheCi;
            this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGridView1.Location = new System.Drawing.Point(0, 112);
            this.dataGridView1.MultiSelect = false;
            this.dataGridView1.Name = "dataGridView1";
            this.dataGridView1.ReadOnly = true;
            this.dataGridView1.RowHeadersVisible = false;
            this.dataGridView1.RowTemplate.Height = 23;
            this.dataGridView1.Size = new System.Drawing.Size(801, 455);
            this.dataGridView1.TabIndex = 13;
            this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
            // 
            // rowIDDataGridViewTextBoxColumn
            // 
            this.rowIDDataGridViewTextBoxColumn.DataPropertyName = "RowID";
            this.rowIDDataGridViewTextBoxColumn.HeaderText = "行号";
            this.rowIDDataGridViewTextBoxColumn.Name = "rowIDDataGridViewTextBoxColumn";
            this.rowIDDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // cheCiDataGridViewTextBoxColumn
            // 
            this.cheCiDataGridViewTextBoxColumn.DataPropertyName = "CheCi";
            this.cheCiDataGridViewTextBoxColumn.HeaderText = "车次";
            this.cheCiDataGridViewTextBoxColumn.Name = "cheCiDataGridViewTextBoxColumn";
            this.cheCiDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // faZhanDataGridViewTextBoxColumn
            // 
            this.faZhanDataGridViewTextBoxColumn.DataPropertyName = "FaZhan";
            this.faZhanDataGridViewTextBoxColumn.HeaderText = "发站";
            this.faZhanDataGridViewTextBoxColumn.Name = "faZhanDataGridViewTextBoxColumn";
            this.faZhanDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // faTimeDataGridViewTextBoxColumn
            // 
            this.faTimeDataGridViewTextBoxColumn.DataPropertyName = "FaTime";
            this.faTimeDataGridViewTextBoxColumn.HeaderText = "发车时间";
            this.faTimeDataGridViewTextBoxColumn.Name = "faTimeDataGridViewTextBoxColumn";
            this.faTimeDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // daoZhanDataGridViewTextBoxColumn
            // 
            this.daoZhanDataGridViewTextBoxColumn.DataPropertyName = "DaoZhan";
            this.daoZhanDataGridViewTextBoxColumn.HeaderText = "到站";
            this.daoZhanDataGridViewTextBoxColumn.Name = "daoZhanDataGridViewTextBoxColumn";
            this.daoZhanDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // daoTimeDataGridViewTextBoxColumn
            // 
            this.daoTimeDataGridViewTextBoxColumn.DataPropertyName = "DaoTime";
            this.daoTimeDataGridViewTextBoxColumn.HeaderText = "到站时间";
            this.daoTimeDataGridViewTextBoxColumn.Name = "daoTimeDataGridViewTextBoxColumn";
            this.daoTimeDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // timeDataGridViewTextBoxColumn
            // 
            this.timeDataGridViewTextBoxColumn.DataPropertyName = "Time";
            this.timeDataGridViewTextBoxColumn.HeaderText = "持续时间";
            this.timeDataGridViewTextBoxColumn.Name = "timeDataGridViewTextBoxColumn";
            this.timeDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // dengSWDataGridViewTextBoxColumn
            // 
            this.dengSWDataGridViewTextBoxColumn.DataPropertyName = "DengSW";
            this.dengSWDataGridViewTextBoxColumn.HeaderText = "商务座";
            this.dengSWDataGridViewTextBoxColumn.Name = "dengSWDataGridViewTextBoxColumn";
            this.dengSWDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // dengTDDataGridViewTextBoxColumn
            // 
            this.dengTDDataGridViewTextBoxColumn.DataPropertyName = "DengTD";
            this.dengTDDataGridViewTextBoxColumn.HeaderText = "特等座";
            this.dengTDDataGridViewTextBoxColumn.Name = "dengTDDataGridViewTextBoxColumn";
            this.dengTDDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // deng1DataGridViewTextBoxColumn
            // 
            this.deng1DataGridViewTextBoxColumn.DataPropertyName = "Deng1";
            this.deng1DataGridViewTextBoxColumn.HeaderText = "一等座";
            this.deng1DataGridViewTextBoxColumn.Name = "deng1DataGridViewTextBoxColumn";
            this.deng1DataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // deng2DataGridViewTextBoxColumn
            // 
            this.deng2DataGridViewTextBoxColumn.DataPropertyName = "Deng2";
            this.deng2DataGridViewTextBoxColumn.HeaderText = "二等座";
            this.deng2DataGridViewTextBoxColumn.Name = "deng2DataGridViewTextBoxColumn";
            this.deng2DataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // ruanWoGaojiDataGridViewTextBoxColumn
            // 
            this.ruanWoGaojiDataGridViewTextBoxColumn.DataPropertyName = "RuanWoGaoji";
            this.ruanWoGaojiDataGridViewTextBoxColumn.HeaderText = "高级软卧";
            this.ruanWoGaojiDataGridViewTextBoxColumn.Name = "ruanWoGaojiDataGridViewTextBoxColumn";
            this.ruanWoGaojiDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // ruanWoDataGridViewTextBoxColumn
            // 
            this.ruanWoDataGridViewTextBoxColumn.DataPropertyName = "RuanWo";
            this.ruanWoDataGridViewTextBoxColumn.HeaderText = "软卧";
            this.ruanWoDataGridViewTextBoxColumn.Name = "ruanWoDataGridViewTextBoxColumn";
            this.ruanWoDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // yingWoDataGridViewTextBoxColumn
            // 
            this.yingWoDataGridViewTextBoxColumn.DataPropertyName = "YingWo";
            this.yingWoDataGridViewTextBoxColumn.HeaderText = "硬卧";
            this.yingWoDataGridViewTextBoxColumn.Name = "yingWoDataGridViewTextBoxColumn";
            this.yingWoDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // ruanZuoDataGridViewTextBoxColumn
            // 
            this.ruanZuoDataGridViewTextBoxColumn.DataPropertyName = "RuanZuo";
            this.ruanZuoDataGridViewTextBoxColumn.HeaderText = "软座";
            this.ruanZuoDataGridViewTextBoxColumn.Name = "ruanZuoDataGridViewTextBoxColumn";
            this.ruanZuoDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // yingZuoDataGridViewTextBoxColumn
            // 
            this.yingZuoDataGridViewTextBoxColumn.DataPropertyName = "YingZuo";
            this.yingZuoDataGridViewTextBoxColumn.HeaderText = "硬座";
            this.yingZuoDataGridViewTextBoxColumn.Name = "yingZuoDataGridViewTextBoxColumn";
            this.yingZuoDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // wuZuoDataGridViewTextBoxColumn
            // 
            this.wuZuoDataGridViewTextBoxColumn.DataPropertyName = "WuZuo";
            this.wuZuoDataGridViewTextBoxColumn.HeaderText = "站票";
            this.wuZuoDataGridViewTextBoxColumn.Name = "wuZuoDataGridViewTextBoxColumn";
            this.wuZuoDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // qiTaDataGridViewTextBoxColumn
            // 
            this.qiTaDataGridViewTextBoxColumn.DataPropertyName = "QiTa";
            this.qiTaDataGridViewTextBoxColumn.HeaderText = "其他";
            this.qiTaDataGridViewTextBoxColumn.Name = "qiTaDataGridViewTextBoxColumn";
            this.qiTaDataGridViewTextBoxColumn.ReadOnly = true;
            // 
            // postParDataGridViewTextBoxColumn
            // 
            this.postParDataGridViewTextBoxColumn.DataPropertyName = "PostPar";
            this.postParDataGridViewTextBoxColumn.HeaderText = "操作";
            this.postParDataGridViewTextBoxColumn.Name = "postParDataGridViewTextBoxColumn";
            this.postParDataGridViewTextBoxColumn.ReadOnly = true;
            this.postParDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
            this.postParDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
            this.postParDataGridViewTextBoxColumn.Text = "选这趟车";
            this.postParDataGridViewTextBoxColumn.UseColumnTextForLinkValue = true;
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.tableLayoutPanel1);
            this.panel1.Controls.Add(this.btnOK);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(801, 112);
            this.panel1.TabIndex = 14;
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.ColumnCount = 4;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 24F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 26F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23F));
            this.tableLayoutPanel1.Controls.Add(this.panel7, 2, 1);
            this.tableLayoutPanel1.Controls.Add(this.panel6, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.panel5, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.panel4, 2, 0);
            this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.panel3, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.panel8, 3, 0);
            this.tableLayoutPanel1.Controls.Add(this.panel9, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.panel10, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.panel11, 2, 2);
            this.tableLayoutPanel1.Controls.Add(this.panel12, 3, 2);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 3;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(801, 80);
            this.tableLayoutPanel1.TabIndex = 12;
            // 
            // panel7
            // 
            this.tableLayoutPanel1.SetColumnSpan(this.panel7, 2);
            this.panel7.Controls.Add(this.txtPassenger_1_cardno);
            this.panel7.Controls.Add(this.label5);
            this.panel7.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel7.Location = new System.Drawing.Point(400, 26);
            this.panel7.Margin = new System.Windows.Forms.Padding(0);
            this.panel7.Name = "panel7";
            this.panel7.Size = new System.Drawing.Size(401, 26);
            this.panel7.TabIndex = 5;
            // 
            // panel6
            // 
            this.panel6.Controls.Add(this.cmbPassenger_1_cardtype);
            this.panel6.Controls.Add(this.label4);
            this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel6.Location = new System.Drawing.Point(192, 26);
            this.panel6.Margin = new System.Windows.Forms.Padding(0);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(208, 26);
            this.panel6.TabIndex = 4;
            // 
            // panel5
            // 
            this.panel5.Controls.Add(this.txtTrain_no);
            this.panel5.Controls.Add(this.label11);
            this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel5.Location = new System.Drawing.Point(0, 26);
            this.panel5.Margin = new System.Windows.Forms.Padding(0);
            this.panel5.Name = "panel5";
            this.panel5.Size = new System.Drawing.Size(192, 26);
            this.panel5.TabIndex = 3;
            // 
            // panel4
            // 
            this.panel4.Controls.Add(this.label9);
            this.panel4.Controls.Add(this.dtTrain_date);
            this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel4.Location = new System.Drawing.Point(400, 0);
            this.panel4.Margin = new System.Windows.Forms.Padding(0);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(216, 26);
            this.panel4.TabIndex = 2;
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.cmbFrom_station_telecode);
            this.panel2.Controls.Add(this.label7);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Margin = new System.Windows.Forms.Padding(0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(192, 26);
            this.panel2.TabIndex = 0;
            // 
            // panel3
            // 
            this.panel3.Controls.Add(this.cmbTo_station_telecode);
            this.panel3.Controls.Add(this.label8);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel3.Location = new System.Drawing.Point(192, 0);
            this.panel3.Margin = new System.Windows.Forms.Padding(0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(208, 26);
            this.panel3.TabIndex = 1;
            // 
            // panel8
            // 
            this.panel8.Controls.Add(this.label10);
            this.panel8.Controls.Add(this.cmbStart_time_str);
            this.panel8.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel8.Location = new System.Drawing.Point(616, 0);
            this.panel8.Margin = new System.Windows.Forms.Padding(0);
            this.panel8.Name = "panel8";
            this.panel8.Size = new System.Drawing.Size(185, 26);
            this.panel8.TabIndex = 5;
            // 
            // panel9
            // 
            this.panel9.Controls.Add(this.txtPassenger_1_name);
            this.panel9.Controls.Add(this.label3);
            this.panel9.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel9.Location = new System.Drawing.Point(0, 52);
            this.panel9.Margin = new System.Windows.Forms.Padding(0);
            this.panel9.Name = "panel9";
            this.panel9.Size = new System.Drawing.Size(192, 28);
            this.panel9.TabIndex = 6;
            // 
            // panel10
            // 
            this.panel10.Controls.Add(this.txtPassenger_1_mobileno);
            this.panel10.Controls.Add(this.label6);
            this.panel10.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel10.Location = new System.Drawing.Point(192, 52);
            this.panel10.Margin = new System.Windows.Forms.Padding(0);
            this.panel10.Name = "panel10";
            this.panel10.Size = new System.Drawing.Size(208, 28);
            this.panel10.TabIndex = 6;
            // 
            // panel11
            // 
            this.panel11.Controls.Add(this.cmbPassenger_1_seat);
            this.panel11.Controls.Add(this.label1);
            this.panel11.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel11.Location = new System.Drawing.Point(400, 52);
            this.panel11.Margin = new System.Windows.Forms.Padding(0);
            this.panel11.Name = "panel11";
            this.panel11.Size = new System.Drawing.Size(216, 28);
            this.panel11.TabIndex = 6;
            // 
            // panel12
            // 
            this.panel12.Controls.Add(this.cmbPassenger_1_ticket);
            this.panel12.Controls.Add(this.label2);
            this.panel12.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel12.Location = new System.Drawing.Point(616, 52);
            this.panel12.Margin = new System.Windows.Forms.Padding(0);
            this.panel12.Name = "panel12";
            this.panel12.Size = new System.Drawing.Size(185, 28);
            this.panel12.TabIndex = 6;
            // 
            // FrmYuDing
            // 
            this.Controls.Add(this.dataGridView1);
            this.Controls.Add(this.panel1);
            this.Name = "FrmYuDing";
            this.Size = new System.Drawing.Size(801, 567);
            ((System.ComponentModel.ISupportInitialize)(this.bdscXiBie)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSetPiaoInfo1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscType)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCardType)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCityCode)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCityCodeEnd)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bdscCheCi)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.panel1.ResumeLayout(false);
            this.tableLayoutPanel1.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel7.PerformLayout();
            this.panel6.ResumeLayout(false);
            this.panel6.PerformLayout();
            this.panel5.ResumeLayout(false);
            this.panel5.PerformLayout();
            this.panel4.ResumeLayout(false);
            this.panel4.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel8.ResumeLayout(false);
            this.panel8.PerformLayout();
            this.panel9.ResumeLayout(false);
            this.panel9.PerformLayout();
            this.panel10.ResumeLayout(false);
            this.panel10.PerformLayout();
            this.panel11.ResumeLayout(false);
            this.panel11.PerformLayout();
            this.panel12.ResumeLayout(false);
            this.panel12.PerformLayout();
            this.ResumeLayout(false);

        }

        private int JXConfirm(string strhtml)
        {
            MethodInvoker method = null;
            Match match = this.frmMain.rexEx.Match(strhtml);
            if(match.Success)
            {
                if(match.Groups[1].Value.Contains("稍后重试"))
                {
                    this.frmMain.WriteInfo("确认订单出错，错误信息：" + match.Groups[1].Value);
                    return 1;
                }
                this.frmMain.WriteInfo("确认订单出错，已停止确认，错误信息：" + match.Groups[1].Value);
            }
            else
            {
                if(this.frmMain.rexSu.IsMatch(strhtml))
                {
                    if(method == null)
                    {
                        method = delegate
                        {
                            try
                            {
                                MessageBox.Show("预定可能已成功，请在浏览器中查看未完成订单信息完成支付！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                this.frmMain.Navigate("https://dynamic.12306.cn/otsweb/order/myOrderAction.do?method=queryMyOrderNotComplete&leftmenu=Y");
                                this.frmMain.ChangeTxt();
                            }
                            catch(Exception exception)
                            {
                                MessageBox.Show(exception.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                Log.WriteLog4Ex("预定成功", exception);
                            }
                        };
                    }
                    base.BeginInvoke(method);
                    //PublicInfo.Proxy.TicketSuccess(PublicInfo.AuthorizeInfo.UserID, PublicInfo.GetDiskID());
                    //AuthorizeInfo authorizeInfo = PublicInfo.AuthorizeInfo;
                    //authorizeInfo.AuthorizeTimes--;
                    return 2;
                }
                if(this.frmMain.rexMang.IsMatch(strhtml))
                {
                    this.frmMain.WriteInfo("系统繁忙，正在重试！");
                    return 3;
                }
                this.frmMain.WriteInfo("未知状态，已停止确认！");
            }
            return 0;
        }

        private void submutOrderRequest(string val)
        {
            //if(string.IsNullOrEmpty(this.txtPassenger_1_cardno.Text))
            //{
            //    MessageBox.Show("未填写身份证信息！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            //}
            //else
            //{
            //    if(string.IsNullOrEmpty(this.txtPassenger_1_name.Text))
            //    {
            //        MessageBox.Show("未填写乘车人姓名信息！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            //    }
            //    else
            //    {
            //        if(string.IsNullOrEmpty(this.txtPassenger_1_mobileno.Text))
            //        {
            //            MessageBox.Show("未填写乘车人手机信息！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            //        }
            //        else
            //        {
            this.frmMain.ChangeState("预定中");
            this.IsRun = true;
            this.dataGridView1.Enabled = false;
            new Thread(delegate()
            {
                try
                {
                    string text = "";
                    int num = 3;
                    string text2 = null;
                    while(this.IsRun)
                    {
                        if(num == 3)
                        {
                            text = this.frmMain.http.PostPage("https://dynamic.12306.cn/otsweb/order/querySingleAction.do?", val);
                            while(this.frmMain.rexMang.IsMatch(text))
                            {
                                this.frmMain.WriteInfo("系统繁忙，正在重试！");
                                this.frmMain.WriteHtml(text);
                                text = this.frmMain.http.PostPage("https://dynamic.12306.cn/otsweb/order/querySingleAction.do?", val);
                            }
                            this.frmMain.WriteHtml(text);
                            num = 1;
                        }
                        if(num == 1)
                        {
                            num = this.confirmPassengerAction(ref text, ref text2);
                            if(num == 0 || num == 2)
                            {
                                break;
                            }
                        }
                    }
                }
                catch(Exception ex)
                {
                    this.frmMain.WriteInfo("确认车次发生错误，错误详细信息：" + ex.Message);
                    Log.WriteLog4Ex("submutOrderRequest", ex);
                }
                finally
                {
                    this.BeginInvoke(
                        (MethodInvoker)delegate()
                        {
                            this.dataGridView1.Enabled = true;
                            MessageBox.Show("自动订票已停止，如未预定成功，请手动重试！", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                    );
                    this.IsRun = false;
                    this.frmMain.ChangeState("待命");
                }
            }
            )
            {
                IsBackground = true
            }.Start();
        }
        //        }
        //    }
        //}

    }
}

